#include "main.h"
#include "gestionMenu.h"

int main( void )
{
	    ::system("TITLE Pratique Examen 2 - MBB");
		::system("COLOR 1F");

		setlocale( LC_ALL, "" );

		//cout << "Position du mot : " << obtenirMiddle(strlen(" =============== MENU PRINCIPAL =============== ")) << endl;
		//::system("pause");

		bool lbFini = false;
		while (!lbFini)
		{
			lbFini = menuPrincipale();
		}
}

int Random(int a, int b)
{
	srand(time(NULL)); 
	return (a + (int)((double)rand() / ((double)RAND_MAX + 1) * b));
}

int obtenirMiddle(int piTailleMot)
{
	int TailleConsole = 80;
	int PositionMilieu = 40;

	int MilieuMot = PositionMilieu-(piTailleMot/2);

	int PositionCarMin = MilieuMot+piTailleMot;

	return PositionCarMin;
}

void afficherMilieu(string pcPhrase)
{
	int TailleConsole = 80;
	int PositionMilieu = 40;
	int TailleMot = pcPhrase.size();
	

	int MilieuMot = PositionMilieu-(TailleMot/2);

	int PositionCarMin = MilieuMot+TailleMot;

	cout << setw(PositionCarMin) << pcPhrase << endl << endl;
}